#ifndef QTGIMP_H
#define QTGIMP_H
#define NULL 0

#include <QtGui/QMainWindow>
#include "ui_qtgimp.h"

#include <cv.h>
#include <highgui.h>
#include <qstring.h>
#include "imagelinkedlist.h"
#include "UndoStack.h"
#include "RedoStack.h"
#include <QMutableLinkedListIterator>

class QtGimp : public QMainWindow
{
	Q_OBJECT

public:
	QtGimp(QWidget *parent = 0, Qt::WFlags flags = 0);
	~QtGimp();

	// konvertierungsfunktionen
	QImage cvToQt(IplImage* iplImage);
	IplImage qtToCv(QImage* qImage);

	// mehrere tempImage
	IplImage *workImage;
	IplImage originalImage;
	IplImage tempImage;
	IplImage *currentImage;

	// liste von Bilder


	//Stack mit allen Bildern
	UndoStack<IplImage>* undoStack;
	RedoStack<IplImage>* redoStack;

	// Ort wo das Bild gespeichert ist
	QString imageLocation;

	
private:
	Ui::QtGimpClass ui;
	QImage img;
	void refreshImage();
	void refreshImage(IplImage*);
	void makeGray(QImage* img);
	

private slots:
	void on_actionRedo_triggered();
	void on_actionUndo_triggered();
	void on_actionScale_triggered();
	void on_actionInfo_triggered();
	void on_actionErode_triggered();
	void on_actionDilate_triggered();
	void on_actionClosing_triggered();
	void on_actionOpening_triggered();
	void on_actionSave_triggered();
	void on_actionThreshold_triggered();
	void on_actionGray_triggered();
	void on_actionOpen_triggered();
	void on_openButton_clicked();
public slots:
	void on_threshold_changed(int);
};

#endif // QTGIMP_H
